from flask import jsonify


def make_response(code=0, message="ok", data=None, status=200):
    return jsonify({
        "code": code,
        "message": message,
        "result": data,
        "type": "success" if code == 0 else "failed"
    }), status
